let str = 'hello es6';

console.log("1611B正在学"+str);

let num = 10;

//模板字符串  `${}`

console.log(`1611B正在学${num>9?'大于':'小于'}`);

//es5 substr  substring(

console.log(str.substr(6,3));

console.log(str.substring(6));

console.log(str.indexOf('p'));

console.log(/o/.test(str));

//es6 trim去空格  trimLeft  trimRight

console.log(str.trimLeft()+'abc');

//includes  startsWith endsWith

//includes  startsWith  第二个参数：开始查找的位置

//endsWith  第二个参数：前几个字符

console.log(str.includes('ell'));

let url = 'file:///D:/1611B/day-01/src/index.html';
console.log(url.startsWith('file',0));

let imgUrl = '1.jpg';

console.log(imgUrl.endsWith('jpg',5))

//repeat  -1 ~ 0之间的小数 取整为0

console.log(str.repeat(0)); //''

//padStart()  padEnd()  填充  

console.log(str.padEnd(str.length+3,'@#')); //





